﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using SkiaSharp;
using SkiaSharp.Views.Forms;
using TabbedTemplate.Models;
using TabbedTemplate.Util;
using Xamarin.Forms;

namespace TabbedTemplate.Converters
{

    public class ItemToSKArgsConverter: IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter,
            CultureInfo culture)
        {
            var surface = (SKSurface)((value as SKPaintSurfaceEventArgs)?.Surface);
            var info = (SKImageInfo) ((value as SKPaintSurfaceEventArgs)?.Info);
            return new SKEventArgsToReturn {Surface = surface, Info = info};

        }

        public object ConvertBack(object value, Type targetType, object parameter,
            CultureInfo culture) {
            throw new DoNotCallThisException();
        }
    }
}
